/*    */ package com.zimbra.qa.unittest;
/*    */ 
/*    */ import com.zimbra.client.ZMailbox;
/*    */ import com.zimbra.client.ZMailbox.ZOutgoingMessage;
/*    */ import com.zimbra.client.ZSearchParams;
/*    */ import com.zimbra.client.ZSearchResult;
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import java.util.List;
/*    */ import junit.framework.TestCase;
/*    */ import org.junit.AfterClass;
/*    */ import org.junit.BeforeClass;
/*    */ import org.junit.Test;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class TestMinusOperator
/*    */   extends TestCase
/*    */ {
/*    */   private static final String USER_NAME = "testuser123";
/*    */   private static final String REMOTE_USER_NAME = "testuser456";
/*    */   private static ZMailbox mbox;
/*    */   
/*    */   @BeforeClass
/*    */   public void setUp()
/*    */     throws ServiceException
/*    */   {
/* 40 */     TestUtil.createAccount("testuser123");
/* 41 */     TestUtil.createAccount("testuser456");
/* 42 */     mbox = TestUtil.getZMailbox("testuser123");
/* 43 */     ZMailbox.ZOutgoingMessage msg = TestUtil.getOutgoingMessage("testuser456", "test message", "far over the misty mountains cold", null);
/* 44 */     mbox.sendMessage(msg, null, false);
/*    */   }
/*    */   
/*    */   @AfterClass
/*    */   public void tearDown() throws ServiceException
/*    */   {
/* 50 */     TestUtil.deleteAccount("testuser123");
/* 51 */     TestUtil.deleteAccount("testuser456");
/*    */   }
/*    */   
/*    */   @Test
/*    */   public void testExcludeText() throws ServiceException {
/* 56 */     ZSearchResult search1 = mbox.search(new ZSearchParams("in:sent test"));
/* 57 */     assertEquals(search1.getHits().size(), 1);
/* 58 */     ZSearchResult search2 = mbox.search(new ZSearchParams("in:sent -test"));
/* 59 */     assertEquals(search2.getHits().size(), 0);
/*    */   }
/*    */   
/*    */   @Test
/*    */   public void testExcludeRecipient() throws ServiceException {
/* 64 */     ZSearchResult search1 = mbox.search(new ZSearchParams("in:sent to:testuser456"));
/* 65 */     assertEquals(search1.getHits().size(), 1);
/* 66 */     ZSearchResult search2 = mbox.search(new ZSearchParams("in:sent -to:testuser456"));
/* 67 */     assertEquals(search2.getHits().size(), 0);
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/qa/unittest/TestMinusOperator.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */